package com.ybf.user.dal.manager;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ybf.user.dal.entity.UserThirdAuthDO;
import com.ybf.user.dal.mapper.UserThirdAuthMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Date
 * @Author
 **/
@Component
public class UserThirdAuthManager extends ServiceImpl<UserThirdAuthMapper, UserThirdAuthDO> {

    @Autowired
    private UserThirdAuthMapper userThirdAuthMapper;

    public UserThirdAuthDO selectByUserId(Long userId){
        return userThirdAuthMapper.selectOne(new LambdaQueryWrapper<UserThirdAuthDO>()
                .eq(UserThirdAuthDO::getUserId, userId));
    }

    public UserThirdAuthDO selectByOpenId(String openId){
        return userThirdAuthMapper.selectOne(new LambdaQueryWrapper<UserThirdAuthDO>()
                .eq(UserThirdAuthDO::getOpenId, openId));
    }
}
